﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using System.Data.SqlClient;
using Ccit.OA.Utils;
using Ccit.Utils;

namespace Ccit.OA.NewsCenter
{
    public partial class news_search_frame : Ccit.Utils.Page
    {
        LoginUser loginUser = null;
        protected void Page_Load(object sender, EventArgs e)
        {
            if(!IsPostBack){
                
                _hidTabId.Value =( null != Request.QueryString["TABID"] ) ? Request.QueryString["TABID"].ToString() : "";

                _hidType.Value = (Request.QueryString["Type"] != null) ? Request.QueryString["Type"].ToString() : "0";                
                loginUser = (LoginUser)Session["LogUserInfo"];

                string sPageParamEdit = "Type=" + _hidType.Value+"&TABID="+_hidTabId.Value;
                string encodeParamEdit = base64encode(sPageParamEdit);
                iFrmTree.Attributes["src"] = "news_search_tree.aspx?" + encodeParamEdit;
                iFrmList.Attributes["src"] = "news_search_list.aspx?"+encodeParamEdit;

                initializePage();
            }
        }
        private string base64encode(string sPageParam)
        {
            string encodeParam = string.Empty;
            if (string.IsNullOrEmpty(sPageParam)) return encodeParam;

            encodeParam = Base64Lib.Encode(sPageParam);
            return encodeParam;
        }
        private void initializePage()
        {
            //NEWS_A8_70 是否为窗口标志:0-否
            //WindowBLL bll = new WindowBLL();
            //string PlateIds = bll.GetPlateIdByType(_hidType.Value);
            //if(PlateIds != "")
            CtrInterface.BindDropDown(ref ddlQuery, "NEWS_A8", "NEWS_A8_10", "NEWS_A8_40", true, "--请选择--", "NEWS_A8_9994='" + loginUser.UserId + "' AND  NEWS_A8_60='1' AND NEWS_A8_30 = '"+_hidType.Value+"'");
        }
    }
}
